<%@ page import="com.zjitc.model.User" %><%--
  Created by IntelliJ IDEA.
  author: Jsonor
  date: 2018/5/7 15:17
  description: Description
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" %>

<html>
<head>
  <title>Title</title>
  <script>
    addEventListener("load", function () {
      setTimeout(hideURLbar, 0);
    }, false);

    function hideURLbar() {
      window.scrollTo(0, 1);
    }
  </script>

  <link rel="stylesheet" href="css/font-awesome.css" type="text/css" media="all">
  <link rel="stylesheet" href="css/style.css" type="text/css" media="all" />

  <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
  <!-- start menu -->
  <script src="cart/js/simpleCart.min.js"> </script>
  <!-- start menu -->
  <link href="cart/css/memenu.css" rel="stylesheet" type="text/css" media="all" />
  <script type="text/javascript" src="cart/js/memenu.js"></script>
  <script>$(document).ready(function(){$(".memenu").memenu();});</script>
  <!-- /start menu -->
  <link href="cart/css/form.css" rel="stylesheet" type="text/css" media="all" />
  <link rel="stylesheet" href="cart/css/flexslider.css" type="text/css" media="screen" />


</head>
<body>
<div class="nav-links">
  <nav class='navbar navbar-default'>
    <div class='container'>
      <div class='navbar-header'>
        <button type='button' class='navbar-toggle' data-toggle='collapse' data-target='.navbar-collapse'>
          <span class='sr-only'>Toggle Navigation</span>
          <span class='icon-bar'></span>
          <span class='icon-bar'></span>
          <span class='icon-bar'></span>
        </button>
      </div>
      <div class='collapse navbar-collapse'>
        <ul>
          <li>
            <a href="${pageContext.request.contextPath}/index.jsp">主页</a>
          </li>
          <li>
            <a href="${pageContext.request.contextPath}/index.jsp#about" class="scroll">关于我们</a>
          </li>
          <li>
            <a href="#services" class="scroll">服务</a>
          </li>
          <li>
            <a href="#blog" class="scroll">种类</a>
          </li>
          <li>
            <a href="#team" class="scroll">团队</a>
          </li>
          <li>
            <a href="#gallery" class="scroll">相册</a>
          </li>
          <%--<li>
            <a href="#contact" class="scroll">联系我们</a>
          </li>--%>
          <li>
            <% User user= (User) request.getSession().getAttribute("user");
              if(user!=null){%>
            <a href="${pageContext.request.contextPath}/manage/editUserInfo.jsp"><%=user.getUsername()%></a>
            <%}else{ %>
            <a href="${pageContext.request.contextPath}/user/login.jsp">登陆 </a>
            <%} %>
          </li>
          <div  style="float: right;margin: 5px" class="cart box_1">
          <a href="/user/cartLIst.do?username=${user.username}">
            <div class="total">
              <span class="simpleCart_total"></span> (<span id="simpleCart_quantity" class="simpleCart_quantity"></span>)</div>
            <span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span>
          </a>
          <%--<p><a href="javascript:;" class="simpleCart_empty">清空购物车</a></p>--%>
          <div class="clearfix"> </div>
        </div>

        </ul>

      </div>
    </div>
  </nav>
</div>
<script>
  $(window).scroll(function () {
    if ($(window).scrollTop() >= 795) {
      $('nav').addClass('fixed-header');
    } else {
      $('nav').removeClass('fixed-header');
    }
  });


</script>
</body>
</html>
